{
	template:`
    <m-page @back="back" :title="title">
        <m-card>
            <div class="flex padding-sm align-center">
                <div class="flex-sub">
                    <div class="flex align-center">
                        <div class="cu-tag radius" :class="'bg-'+model.user.store.color">{{model.user.store.name}}</div>
                        <div class="padding-left-xs">{{model.user.realName}}</div>
                    </div>
                    <div>{{model.yearMonth}} 实发{{formatAmount(model.payAmount)}}元</div>
                    <div v-if="model.status=='Y'" class="text-sm text-green">{{model.confirmUser.realName}}已发放 {{formatDate(model.confirmDate,'yyyy-MM-dd')}}</div>
                    <div v-else class="text-sm text-red">未发放</div>
                </div>
                <div class="text-right text-sm text-grey">
                    月薪：<br/>
                    提成：<br/>
                    奖励：
                </div>
                <div class="text-right text-sm">
                    {{formatAmount(model.wages)}}元<br/>
                    {{formatAmount(model.wagesAmount)}}元<br/>
                    {{formatAmount(model.rewardAmount)}}元
                </div>
            </div>
        </m-card>
		<m-list ref="list" :url="url" :params="params" :bottom="0" :search="search">
			<template #item="{item}">
				<m-card join @click="viewOrder(item)">
					<div class="flex padding-sm align-center">
                        <div v-if="item.type=='order'" class="cu-tag radius bg-blue">订单</div>
                        <div v-if="item.type=='recharge'" class="cu-tag radius bg-green">充值</div>
						<div class="flex-sub padding-lr-sm">
						    <span class="padding-right-xs">{{item.orderNo}}</span>
						    {{formatDate(item.accountDate,'yyyy-MM-dd')}}
						    <div>实付金额：{{formatAmount(item.payAmount)}}</div>
						</div>
						<div class="text-right text-red">
						    <div v-if="item.wagesAmount">+{{formatAmount(item.wagesAmount)}}</div>
						    <div v-if="item.rewardAmount" class="text-sm padding-top-xs">+{{formatAmount(item.rewardAmount)}}</div>
						</div>
					</div>
				</m-card>
			</template>
		</m-list>
    </m-page>
	`,
	props: ['param','parentVue'],
	data:function(){
		return {
            title:'工资明细',
            url:'action/order/monthWages/getDetailList',
            params:{'monthWages.oid@eq':'','accountDate#asc':'Y'},
            search:[
                {title:'订单编号',name:'orderNo@like',input:'text'},
                {title:'实付金额',name:'payAmount',input:'numberRange'},
            ],
            model:{user:{store:{}},confirmUser:{}}
		};
	},
	mounted(){
	    this.params['monthWages.oid@eq']=this.param.oid;
        this.requestData('action/order/monthWages/getInfo',
            {oid:this.param.oid},
            (data)=>{
                if(data.code==0){
                    this.model=data.model;
                }
            }
        );
	},
	methods:{
	    viewOrder:function(item){
	        if(item.type=='order'){
                this.openPage('order/orderInfo.js',{oid:item.busiOid},(flag,obj)=>{});
	        } else if(item.type='recharge'){
	            this.openPage('order/memberRecharge.js',{oid:item.busiOid},(flag,obj)=>{});
	        } else{
                this.remind().error("类型错误");
	        }
	    }
	}
}